Optimal. Leaf size=160 \[ \frac{a^2 (d \tan (e+f x))^{n+1} \text{Hypergeometric2F1}\left (1,\frac{n+1}{2},\frac{n+3}{2},-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac{2 a b \sec (e+f x) \cos ^2(e+f x)^{\frac{n+2}{2}} (d \tan (e+f x))^{n+1} \text{Hypergeometric2F1}\left (\frac{n+1}{2},\frac{n+2}{2},\frac{n+3}{2},\sin ^2(e+f x)\right )}{d f (n+1)}+\frac{b^2 (d \tan (e+f x))^{n+1}}{d f (n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.182092, antiderivative size = 160, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3886, 3476, 364, 2617, 2607, 32} \[ \frac{a^2 (d \tan (e+f x))^{n+1} \, _2F_1\left (1,\frac{n+1}{2};\frac{n+3}{2};-\tan ^2(e+f x)\right )}{d f (n+1)}+\frac{2 a b \sec (e+f x) \cos ^2(e+f x)^{\frac{n+2}{2}} (d \tan (e+f x))^{n+1} \, _2F_1\left (\frac{n+1}{2},\frac{n+2}{2};\frac{n+3}{2};\sin ^2(e+f x)\right )}{d f (n+1)}+\frac{b^2 (d \tan (e+f x))^{n+1}}{d f (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3886
Rule 3476
Rule 364
Rule 2617
Rule 2607
Rule 32
Rubi steps
\begin{align*} \int (a+b \sec (e+f x))^2 (d \tan (e+f x))^n \, dx &=\int \left (a^2 (d \tan (e+f x))^n+2 a b \sec (e+f x) (d \tan (e+f x))^n+b^2 \sec ^2(e+f x) (d \tan (e+f x))^n\right ) \, dx\\ &=a^2 \int (d \tan (e+f x))^n \, dx+(2 a b) \int \sec (e+f x) (d \tan (e+f x))^n \, dx+b^2 \int \sec ^2(e+f x) (d \tan (e+f x))^n \, dx\\ &=\frac{2 a b \cos ^2(e+f x)^{\frac{2+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{2+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{b^2 \operatorname{Subst}\left (\int (d x)^n \, dx,x,\tan (e+f x)\right )}{f}+\frac{\left (a^2 d\right ) \operatorname{Subst}\left (\int \frac{x^n}{d^2+x^2} \, dx,x,d \tan (e+f x)\right )}{f}\\ &=\frac{b^2 (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{a^2 \, _2F_1\left (1,\frac{1+n}{2};\frac{3+n}{2};-\tan ^2(e+f x)\right ) (d \tan (e+f x))^{1+n}}{d f (1+n)}+\frac{2 a b \cos ^2(e+f x)^{\frac{2+n}{2}} \, _2F_1\left (\frac{1+n}{2},\frac{2+n}{2};\frac{3+n}{2};\sin ^2(e+f x)\right ) \sec (e+f x) (d \tan (e+f x))^{1+n}}{d f (1+n)}\\ \end{align*}
Mathematica [A] time = 1.35733, size = 178, normalized size = 1.11 \[ \frac{d \left (-\tan ^2(e+f x)\right )^{-n/2} (d \tan (e+f x))^{n-1} \left (-a^2 \left (-\tan ^2(e+f x)\right )^{\frac{n+2}{2}} \text{Hypergeometric2F1}\left (1,\frac{n+1}{2},\frac{n+3}{2},-\tan ^2(e+f x)\right )+2 a b (n+1) \sqrt{-\tan ^2(e+f x)} \sec (e+f x) \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{1-n}{2},\frac{3}{2},\sec ^2(e+f x)\right )+b^2 \left (\sqrt{-\tan ^2(e+f x)}-\left (-\tan ^2(e+f x)\right )^{\frac{n+2}{2}}\right )\right )}{f (n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.946, size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\sec \left ( fx+e \right ) \right ) ^{2} \left ( d\tan \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (f x + e\right ) + a\right )}^{2} \left (d \tan \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (b^{2} \sec \left (f x + e\right )^{2} + 2 \, a b \sec \left (f x + e\right ) + a^{2}\right )} \left (d \tan \left (f x + e\right )\right )^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \tan{\left (e + f x \right )}\right )^{n} \left (a + b \sec{\left (e + f x \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (f x + e\right ) + a\right )}^{2} \left (d \tan \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]